/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

/**
 *
 * @author Java
 */
public class ErrorMethod extends Handler  {
     private Request req;

    ErrorMethod(Request req) {
        this.req = req;
    }

    @Override
    public Response readFile() throws FileNotFoundException, IOException {
        byte[] buffer = null;
    
        String path1=".\\MyPrograms\\error.html";
        try {
            File f1 = new File(".\\MyPrograms\\error.html");
            
            	InputStream is = new FileInputStream(f1);
                buffer = new byte[(int) f1.length()];
                is.read(buffer);            
        }
        catch (Exception io) {
        }
           	Response t = new Response(req.getSoket(), buffer,path1, req.getId(), req.getConfigBoolean());
        	return t;        
    }
}
